-- GENERATED SPELL FOR [Captain Gerogg Hammertoe] --


function spell0_5851(pUnit, Event) --@Defensive Stance,Self--
pUnit:FullCastSpellOnTarget(7164,pUnit)
pUnit:RegisterEvent('Sorts_5851', 582, 1)
end

function spell1_5851(pUnit, Event) --@Shield Bash,n/a--
pUnit:FullCastSpellOnTarget(1672,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_5851', 6000, 1)
end

function spell2_5851(pUnit, Event) --@Shield Wall,Self--
pUnit:FullCastSpellOnTarget(871,pUnit)
pUnit:RegisterEvent('Sorts_5851', 12000, 1)
end

function Sorts_5851(pUnit, Event)
local choix_sorts_5851 = math.random(0, 2)
if choix_sorts_5851 == 0 then
pUnit:RegisterEvent('spell0_5851', 1, 1)
end
if choix_sorts_5851 == 1 then
pUnit:RegisterEvent('spell1_5851', 1, 1)
end
if choix_sorts_5851 == 2 then
pUnit:RegisterEvent('spell2_5851', 1, 1)
end
end

function mob5851_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_5851', math.random(1500, 3000), 1)
end

function mob5851_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5851_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob5851_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(5851, 1, 'mob5851_Action')
RegisterUnitEvent(5851, 2, 'mob5851_Leave')
RegisterUnitEvent(5851, 3, 'mob5851_Kill')
RegisterUnitEvent(5851, 4, 'mob5851_Die')
